package demo6;

public class Singleton {
    private static Singleton instance = new Singleton();//饿汉模式:
    private Singleton(){}//私有构造方法
    public static Singleton getInstance(){
        return instance;
    }
}
